package com.authine.cloudpivot.ext.enums;
/**
 * 流程编码类型
 * author Ivan.Zhao
 */
public enum WorkFlowCodeEnum {

    ORDER("1", "order_approval_flow"), //订单
    CALIBRATION("2", "calibration_approval_flow"),//定标
    GOODSPRICE("3", "goodsPriceFlow"), // 调价
    INVOICE("4", "invoice_approve"), // 开票
    PURCHASEPAYMENT("5", "purchasePaymentApprov");//付款

    public String id;
    public String text;

    WorkFlowCodeEnum(String id, String text) {

        this.id = id;
        this.text = text;
    }

    public static String getText(Object id) {
        if (id == null) {
            return null;
        }

        for (WorkFlowCodeEnum c : WorkFlowCodeEnum.values()) {
            if (String.valueOf(id).equals(String.valueOf(c.id))) {
                return c.text;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
